package com.taocyb.constant;

/**
 * 启动状态
 */
public enum EnableStatus {
	YES(1, "启用"), NO(0, "停用");

	public final int key;
	public final String value;

	private EnableStatus(int key, String value) {
		this.key = key;
		this.value = value;
	}

	/**
	 * 根据key返回枚举对象
	 */
	public static EnableStatus getEnum(int key) {
		EnableStatus[] objects = EnableStatus.values();
		for (EnableStatus obj : objects) {
			if (obj.key == key) {
				return obj;
			}
		}

		return null;
	}

	public int getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}
}
